﻿// ***********************************************************************
// Assembly         : STX.Lib
// Author           : seven.x
// Created          : 02-10-2014
//
// Last Modified By : seven.x
// Last Modified On : 02-10-2014
// ***********************************************************************
// <copyright file="RegexStrings.cs" company="驰创数码">
//     Copyright (c) 驰创数码. All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace System
{
    /// <summary>
    /// Class CommonlyUsedRegex.
    /// </summary>
    public static class CommonlyUsedRegex
    {
        /// <summary>
        /// The email
        /// </summary>
// ReSharper disable once InconsistentNaming
        public const string regexEmail = @"^[\_]*([a-z0-9]+(\.|\_*)?)+@([a-z][a-z0-9\-]+(\.|\-*\.))+[a-z]{2,6}$";

        public static bool IsEmail(string value)
        {
            var regex = new Regex(regexEmail, RegexOptions.IgnoreCase | RegexOptions.Singleline);
            return regex.Match(value).Success;
        }
    }
}
